package com.mapper;
import com.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("SELECT * FROM user WHERE username = #{username} AND password = #{password}")
    User login(@Param("username") String username, @Param("password") String password);

    @Insert("INSERT INTO user(username, password, email, phone) VALUES(#{username}, #{password}, #{email}, #{phone})")
    void insert(User user);

    @Select("SELECT * FROM user")
    List<User> findAll();

    @Update("UPDATE user SET status = 'disabled' WHERE id = #{id}")
    void disable(Long id);
}
